package com.nihao001.parse.handler.impl;

import org.jsoup.select.Elements;

import com.nihao001.parse.handler.Handler;


/**
 * 
 * <p>Description:please enter information.....</p>
 * 
 * <p>Author: wang xing yue</p>
 * <p>Date  :Nov 12, 2013</p>
 *
 */

public class AttributeHandler implements Handler {
	
	private String attr = null;
	
	public AttributeHandler(String attr){
		this.attr = attr;
	}

	@Override
	public String parse(String html, Elements eles) {
		if(eles == null || eles.size() == 0){
			return "";
		}
		return eles.first().attr(this.attr).trim();
	}

}


